#include <iostream>
#include "scene.h"
#include "menu_scene.h"
#include "game_scene.h"
#include <memory>

int main() {
    auto& sceneManager = SceneManager::GetInstance();
    sceneManager.Initialize();

    initgraph(1280, 720);

    BeginBatchDraw();

    static bool running = true;
    int FPS = 60;
    ExMessage msg;

    while(running){
        DWORD frame_start_time = GetTickCount();

        while(peekmessage(&msg)){
        }


        cleardevice();
        FlushBatchDraw();

        DWORD frame_end_time = GetTickCount();
        DWORD frame_delta_time = frame_end_time-frame_start_time;
        if(frame_delta_time<1000/FPS){
            Sleep(1000/FPS - frame_delta_time);
        }
    }

    EndBatchDraw();

    return 0;
}